home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt40s1.arc / GETASYNC.MOD < prev    next >
Text File  |  1986-11-08  |  2KB  |  42 lines

  1. (*----------------------------------------------------------------------*)
  2. (*     Get_Async_Integer   --- get integer in biased VT52 form          *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Get_Async_Integer( VAR Integr: INTEGER );
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*   Procedure: Get_Async_Integer                                       *)
  10. (*                                                                      *)
  11. (*   Purpose:  Gets integer in biased VT52 form from COM port           *)
  12. (*                                                                      *)
  13. (*   Calling sequence:                                                  *)
  14. (*                                                                      *)
  15. (*      Get_Async_Integer( Var Integr: INTEGER );                       *)
  16. (*                                                                      *)
  17. (*         Integr: Returned integer value                               *)
  18. (*                                                                      *)
  19. (*   Calls:  None                                                       *)
  20. (*                                                                      *)
  21. (*   Remarks:                                                           *)
  22. (*                                                                      *)
  23. (*      The screen positions on the VT52 are expressed in excess 31     *)
  24. (*      notation.  That is, the value 31 is added to each row and       *)
  25. (*      column value.                                                   *)
  26. (*                                                                      *)
  27. (*----------------------------------------------------------------------*)
  28.  
  29. VAR
  30.    C  : INTEGER;
  31.  
  32. BEGIN (* Get_Async_Integer *)
  33.  
  34.    Async_Receive_With_TimeOut( 5 , C );
  35.  
  36.    IF C = TimeOut THEN
  37.       Integr := 0
  38.    ELSE
  39.       Integr := C - 31;
  40.  
  41. END   (* Get_Async_Integer *);
  42.